<?php

use Illuminate\Routing\Router;

Route::group([
	'prefix' => 'admin/EsStandard',
	'namespace' => 'Buu\\Modules\\EsStandard\\Controllers',
	'middleware' => [
		'web',
		'admin'
	],
], function (Router $router) {
	//es实例
	$router->get('es-instance/getIndexs', EsInstanceController::class . '@getIndexs');
	$router->resource('es-instance', EsInstanceController::class);
    $router->post('es-instance/operate-create', EsInstanceController::class . '@operateCreate');

    //数据库表管理
	$router->get('db-tables/getColumns', DbTablesController::class . '@getColumns');
	$router->resource('db-tables', DbTablesController::class);

	//es同步管理
	$router->get('es-index', EsIndexController::class . '@index');
	$router->get('es-index/add', EsIndexController::class . '@setting');
	$router->get('es-index/{id}/{active}/edit', EsIndexController::class . '@setting');
	$router->post('es-index/save/{id}', EsIndexController::class . '@basicSave');
	$router->put('es-index/save/{id}', EsIndexController::class . '@basicSave');
	$router->delete('es-index/{id}', EsIndexController::class . '@delete');
//	$router->resource('es-index', EsIndexController::class);

	//es和db字段映射
	$router->get('es-db-mapping/{id}/add', EsDbMappingController::class . '@add');
	$router->get('es-db-mapping/{id}/{sid}/edit', EsDbMappingController::class . '@edit');
	$router->post('es-db-mapping/{id}/save', EsDbMappingController::class . '@save')->name('mapping.save');
	$router->put('es-db-mapping/{id}/save', EsDbMappingController::class . '@save');
	$router->get('es-db-mapping/{id}/{sid}/delete', EsDbMappingController::class . '@delete');
    $router->get('es-db-mapping/getDbTablesIds', EsDbMappingController::class . '@getDbTablesIds');


    //es字段管理
	$router->put('es-column/{id}/save', EsColumnController::class . '@save');

	//es索引任务管理
    $router->resource('es-index-task', EsIndexTaskController::class);
    $router->post('es-index-task/{id}/save', EsIndexTaskController::class . '@save');
    $router->put('es-index-task/{id}/save', EsIndexTaskController::class . '@save');
    $router->post('es-index-task/save', EsIndexTaskController::class . '@save');
    $router->get('es-index-task/{id}/start', EsIndexTaskController::class . '@start');


});

